Sort the Matrix Diagonally C